// @ts-nocheck
import { defineConfig } from 'umi';
import routes from './router.config';
import proxy from './proxy';

export default defineConfig({
  plugins: [path.resolve(__dirname, '../plugins/umi-plugins/antd-theme/index.ts')],
  antdTheme: themePluginConfig,
  alias: {
    opusTH: path.resolve(__dirname, '../packages/opusTH'),
  },
  title: false,
  antd: {},
  dva: {
    immer: true,
    hmr: false,
    // skipModelValidate: true,
  },
  locale: {
    default: 'en-US',
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@/components/PageLoading/index',
  },
  targets: {
    ie: 11,
  },
  pwa: false,
  hash: true,
  devtool: process.env.SOURCE_MAP === '1' && 'eval-cheap-module-source-map',
  routes,

 
  manifest: {
    basePath: '/',
  },
  extraBabelPlugins: [
    [
      'wildcard',
      {
        exts: ['js', 'jsx', 'ts', 'tsx'],
        nostrip: true,
        useCamelCase: true,
        noModifyCase: true,
      },
    ],
  ],
  chunks: ['vendors', 'umi'],
  chainWebpack: webpackPlugin,
  proxy: {
   
    ...proxy,
  },
  nodeModulesTransform: {
    type: 'none',
  },
  
  runtimePublicPath: true,
  publicPath: '/opus-ui/static/',
  terserOptions: {
    compress: {
      drop_console: ['log', 'info'], // 生产删除console.log\console.info
    },
  },
});
